import request from '@/router/axios';
import { baseUrl, activeUrl } from '@/config/env';
//登录
export const loginByUsername = (uname, password) => request({
    url: baseUrl + '/login',
    method: 'post',
    data: {
        password,
        usrName: uname
    },
    meta: {
        isToken: false
    }
})

//获取当前用户菜单接口
export const getMenu = () => request({
    url: baseUrl + '/cp/usr/func/new_left_menu',
    method: 'get'
});

export const getFormMenu = () => request({
    url: activeUrl + '/api/form/list',
    method: 'get'
})
//
export const getUserInfo = () => request({
    url: '/user/getUserInfo',
    method: 'get'
});

export const refeshToken = () => request({
    url: '/user/refesh',
    method: 'post'
})



// export const getMenu = (type = '0') => request({
//     url: baseUrl + '/backletter/menu',
//     method: 'get',
//     data: {
//         type
//     }
// });

export const getTopMenu = () => request({
    url: '/user/getTopMenu',
    method: 'get'
});

export const sendLogs = (list) => request({
    url: '/user/logout',
    method: 'post',
    data: list
})

export const logout = () => request({
    url: '/user/logout',
    meta: {
        isToken: false
    },
    method: 'get'
})